'use strict';

const db = uniCloud.database()
exports.main = async (event, context) => {
	const { uuid } = event;
	
	try {
		let res = await db.collection("users").where({
			uuid
		}).update({
			role: 0
		})
		
		return {
			code: 200,
			message: '角色更新成功',
			data: res
		}
	} catch (err) {
		return {
			code: 500,
			message: '角色更新失败',
			error: err
		}
	}
};
